home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / WMS.CAB / DigestAuthenRealmAdmin.asp < prev    next >
Encoding:
Text File  |  2003-02-21  |  5.5 KB  |  173 lines

  1. ∩╗┐<%@ Language=VBScript CODEPAGE=65001 %>
  2. <!--#include file="include/wmsLocStrings.inc"-->
  3. <!--#include file="include/wmsServerHash.inc"-->
  4. <!--#include file="include/wmsPlugins.inc"-->
  5. <!--#include file="include/wmsHeader.inc"-->
  6. <!--#include file="include/wmsPageBanner.inc"-->
  7. <!--#include file="include/wmsError.inc"-->
  8. <%
  9. '+-------------------------------------------------------------------------
  10. '
  11. '  Microsoft Windows Media
  12. '  Copyright (C) Microsoft Corporation. All rights reserved.
  13. '
  14. '  File:       DigestAuthenRealmAdmin.asp
  15. '
  16. '  Contents:
  17. '
  18. '--------------------------------------------------------------------------
  19.  
  20. ConnectToPlugin
  21. ConnectToPluginAdmin
  22.  
  23. BeginErrorHandling
  24.  
  25. on error resume next
  26.  
  27. Dim bError
  28. dim strRealm
  29. Dim dwTabIndex
  30. dwTabIndex = 0
  31.  
  32. strRealm = Left( RemoveSpecifiedChars( SafeUnescape( posting( "realm" ) ), REGEXP_DANGEROUS_CHARS ), MAX_LEN_REALM )
  33.  
  34. Dim strOp
  35. strOp = trim( posting( "submit" ) )
  36. if( 0 < Len( strOp ) ) then
  37.     if ( 0 >= Len( strRealm ) ) then
  38.         err.raise( -1 )
  39.         err.description = RemoveDangerousCharacters( L_SPECIFYREALM_TEXT )
  40.         ErrorDetected( "Realm" )
  41.         Session( "PageReloadedToDisplayError" ) = 1
  42.         bError = TRUE
  43.     else
  44.         g_objPluginAdmin.Realm = CStr( strRealm )
  45.  
  46.         if( ErrorDetected( "Realm" ) ) then
  47.             Session( "PageReloadedToDisplayError" ) = 1
  48.             bError = TRUE
  49.         else
  50.             if( "" <> g_strEncodedPubPointName ) then
  51.                 Response.Redirect( "../pubpoints/pubpoint_props.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&category=" & g_strCategory & "&pluginIndex=" & qs("pluginIndex") )
  52.             else
  53.                 Response.Redirect( "../server_props.asp?server=" & g_strQueryStringServer & "&category=" & g_strCategory & "&pluginIndex=" & qs("pluginIndex") )
  54.             end if
  55.         end if
  56.     end if
  57. else
  58.     strRealm = RemoveSpecifiedChars( SafeUnescape( CStr( g_objPluginAdmin.Realm ) ), REGEXP_DANGEROUS_CHARS )
  59. end if
  60.  
  61. WriteHTMLHeader( g_strDecodedServerName ) 
  62. %>
  63. <link rel="stylesheet" type="text/css" href="<%= Session( "cssName" ) %>">
  64. <% WritePluginJSUtils %>
  65. <script language="JavaScript">
  66. <!--
  67. /*@cc_on @*/
  68.  
  69. //////////////////////////////////////////////////////////////////////////////////
  70. function ValidateRealm()
  71. {
  72.     <% jsTRY %>
  73.         var bEnableOkay = true;
  74.         var szRealmUnfiltered = new String( document.pluginForm.realm.value );
  75.         var szRealmFiltered = "";
  76.         
  77.         // perform left trim
  78.         szRealmUnfiltered = szRealmUnfiltered.replace( /^\s+/, "" );
  79.  
  80.         // perform right trim
  81.         szRealmUnfiltered = szRealmUnfiltered.replace( /\s+$/, "" );
  82.         
  83.         if( 0 == szRealmUnfiltered.length )
  84.         {
  85.             document.pluginForm.ok.disabled = true;
  86.             return;
  87.         }
  88.         
  89.         if( bEnableOkay )
  90.         {
  91.             szRealmFiltered = szRealmUnfiltered.replace( /\`|\'|!|@|#|\$|%|\^|\&|\||{|}|;|:|\<|\>|\?|\"/g, "" );
  92.             if( szRealmUnfiltered != szRealmFiltered )
  93.             {
  94.                 bEnableOkay = false;
  95.             }
  96.         }
  97.         
  98.         if( bEnableOkay )
  99.         {
  100.             document.pluginForm.realm.style.color = "#000000";
  101.             document.pluginForm.ok.disabled = false;
  102.         }
  103.         else
  104.         {
  105.             document.pluginForm.realm.style.color = "#ff0000";
  106.             document.pluginForm.ok.disabled = true;
  107.         }
  108.     <% jsCATCH %>
  109. }
  110. -->
  111. </script>
  112. </head>
  113. <body class="pluginBody" oncontextmenu="JavaScript:event.cancelBubble=true;return false;">
  114. <% DrawPluginBanner %>
  115. <table width="90%">
  116. <tr>
  117.     <td valign=top>
  118.         <% WriteStdPluginForm %>
  119.         <table class="propgroupbox" width="90%" cellspacing="0" cellpadding="3">
  120.         <tr>
  121.             <td>
  122.                 <div class="helptext" align="left"><%= Server.HTMLEncode( L_DIGESTHELP_TEXT ) %></div><br>
  123.             </td>
  124.         </tr>
  125.         <tr>
  126.             <td>
  127.                 <div class="helptext"><% RenderWithErrorCheck Server.HTMLEncode( L_REALMCOLON_TEXT ), "Realm" %><br></div>
  128.             </td>
  129.         </tr>
  130.         <tr>
  131.             <td>
  132.                 <input 
  133.                     type="text" 
  134.                     name="realm" 
  135.                       size="75"
  136.                     maxlength="<%= Server.HTMLEncode( MAX_LEN_REALM ) %>" 
  137.                     value="<%= RemoveSpecifiedChars( strRealm, REGEXP_DANGEROUS_CHARS ) %>" 
  138.                     tabindex="1"
  139.                     onChange="JavaScript:ValidateRealm();"
  140.                     onPaste="JavaScript:ValidateRealm();"
  141.                     onKeyDown="JavaScript:ValidateRealm();"
  142.                     onKeyUp="JavaScript:ValidateRealm();"
  143.                     ><br>
  144.             </td>
  145.         </tr>
  146.         </table>
  147.         <br>
  148.     </td>
  149. </tr>
  150. <tr>
  151.     <td valign=bottom>
  152.         <input type="submit" align="baseline" name="ok" value="<%= Server.HTMLEncode( L_OKAYBUTTON_TEXT ) %>" =2> 
  153.         <input type="button" align="baseline" name="cancel" onclick="JavaScript:Cancel();" value="<%= Server.HTMLEncode( L_CANCELBUTTONSPACED_TEXT ) %>" tabIndex="3"> 
  154.         <input type="button" align="baseline" name="help" onclick="JavaScript:DoPluginHelp( '<%= H_DIGAUTHENHELPTOPIC %>' );" value="<%= Server.HTMLEncode( L_HELPBUTTONSPACED_TEXT ) %>" id="help" tabindex=4>
  155.     </td>
  156. </tr>
  157. </table>
  158. </font>
  159. </form>
  160. <%
  161. AlertUserWithPopupErrorDialog
  162. OnErrorGoBack
  163. DrawStdFooter
  164. %>
  165. </body>
  166. </html>
  167. <% 
  168. LatchCurrentPage "plugins/DigestAuthenRealmAdmin.asp", qs
  169. EndErrorHandling "DigestAuthenRealmAdmin.asp" 
  170.  
  171. on error resume next
  172. PluginsASPCleanup
  173. %>